// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import axios from 'axios'
// Vue.prototype.axios = axios //组件调用this.axios.get(...)
// Vue.prototype.$ajax = axios  //换个名字 组件调用this.$ajax.get(...)
window.axios = axios;  //组件中调用 axios.get(...)
Vue.config.productionTip = false

axios.defaults.baseURL = 'http://adtest.lehuotl.com';
axios.defaults.withCredentials = true;
axios.defaults['Access-Control-Allow-Origin'] = 'http://adtest.lehuotl.com';

axios.get('/login/autoLogin').then(function(res){
	if(res.data.success){
		console.log('登录成功');
	}else{
		console.error('登录失败');
	}
}).catch(function(err){
	console.log(err);
});





/* eslint-disable no-new */
new Vue({
	el: '#app',
	router,
	template: '<App/>',
	components: { App }
})